<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>点击停止</button>
    <script>
        var but=document.querySelector('button')
        var aa=setTimeout(function(){
            alert('牢大肘击丛章旭')
        },3000)
        but.onclick=function(){
            //停止
            clearTimeout(aa)
        }
    </script>
</body>
</html>